Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with regex check + missing outputs in v2.6.0 #40

Merged
merged 6 commits into from
Nov 2, 2022

Conversation

Dids
Copy link
Contributor

@Dids Dids commented Nov 2, 2022

In v2.6.0, the regex check was added for delete_preview_after, which would populate the EXPIRATION_HOURS variable with the expiration hours value.

However, this regex check did not take into account commented out lines in a Docker Compose file, which meant that not only would this work incorrectly when ran, but if there were multiple commented out entries with a matching line/value, it would return every commented out result, such as the following:

  ...
  #   # delete_preview_after: 1h
  #   # delete_preview_after: 24h
  #   delete_preview_after: 72h
  ...

The example above would cause the workflow to fail with the following:

/home/runner/work/_temp/cd737192-c615-47af-8150-73e1d6c4ef3a.sh: line 23: 1
24
72 * 3600 : syntax error in expression (error token is "24
72 * 3600 ")

This proposed regex change will still return all results, however since it now also ignores commented out lines, this shouldn't matter and should purely be user error, in case the user is defining the same values two (or more) times per compose file.

UPDATE

I additionally noticed that PR #35 seems to have broken more than it has fixed, and I'm not quite sure what the idea was with replacing the already working logic with environment variables.

The PR mentioned above removed the deprecated set-output method of defining outputs, however it never implemented the new way of creating outputs, which means that the reusable workflow no longer exports any of the outputs.

I made an additional commit that fixes this, but I would advise rewriting/refactoring the entire workflow file, as the order of the jobs/steps, as well as the now even more unnecessarily complex dependency, variable and output logic, are all making it that much harder to find issues in and to improve in the future.

NOTE: In addition to fixing this, I also added expiration and expiration_interval to the actual action's outputs, however I'm not sure if these are currently being exported by the action itself. So just FYI.

EDIT: Also added expiration_timestamp in UNIX timestamp format, as this is the most versatile and useful option when integrating with other services and workflows.

@Dids Dids changed the title Fix issue with regex check in v2.6.0 Fix issue with regex check + missing outputs in v2.6.0 Nov 2, 2022
@axisofentropy axisofentropy merged commit 6f946b7 into UffizziCloud:master Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants